import request from '@/utils/request'

// 获取消息列表
export function getMessageList(query) {
  return request({
    url: '/ruoyi-system/sysMessage/list',
    method: 'get',
    params: query,
  })
}

// 获取未读消息数量
export function getUnreadCount() {
  return request({
    url: '/ruoyi-system/sysMessage/unreadCount',
    method: 'get',
  })
}

// 标记消息为已读
export function markMessageRead(data) {
  return request({
    url: `/ruoyi-system/sysMessage/updateMsgStatusRead`,
    method: 'post',
    data,
  })
}

// 批量标记消息为已读
export function markAllRead() {
  return request({
    url: '/ruoyi-system/sysMessage/readAll',
    method: 'put',
  })
}

// 删除消息
export function deleteMessage(id) {
  return request({
    url: `/ruoyi-system/sysMessage/${id}`,
    method: 'delete',
  })
}

// 获取消息详情
export function getMessageDetail(id) {
  return request({
    url: `/ruoyi-system/sysMessage/${id}`,
    method: 'get',
  })
}
